<template>
  <div class="myParrent-detail-container">
    <div class="header"></div>
    <div class="content">
      <div class="top-info">
        <div class="top-info-list">
          <span>编号:</span>
          <span>{{detail.code}}</span>
        </div>
        <div class="top-info-list">
          <span>昵称:</span>
          <span>{{detail.s_name}}</span>
        </div>
        <div class="top-info-list">
          <span>姓名:</span>
          <span>{{detail.realname}}</span>
        </div>
        <div class="top-info-list">
          <span>电话:</span>
          <span>{{detail.mobile}}</span>
        </div>
        <img :src="detail.icon" alt="">
      </div>
    </div>
    <h2>家长详情</h2>
    <div class="list">
      <span>推荐人:</span>
      <span>{{detail.agentparent}}</span>
    </div>
    <div class="list">
      <span>绑定等级：</span>
      <span>{{detail.leveltext}}</span>
    </div>
    <div class="list">
      <span>绑定时间：</span>
      <span>{{detail.addtime}}</span>
    </div>
  </div>
</template>
  <script>
export default {
  data() {
    return {
      detail: {}
    };
  },

  created() {
    this.initPage()
  },
  methods: {
    initPage() {
      let that = this;
      Toast.loading({ message: '加载中...', forbidClick: true });
      $.ajax({
        type: 'POST',
        url: "{php echo $this->createMobileUrl('w_work', array('schoolid' => $schoolid,'type'=>'countparent_my','todo'=>'index','submittype'=>'AJAX'))}",
        data: {},
        dataType: 'json',
        success: function (res) {
          Toast.clear();
          console.log('res', res)
          if (res.status === 1) {
            that.parenttotal = res.datalist.parenttotal;
            that.starTotal = res.datalistisstar.totalisstar;
            let list = Array.isArray(res.datalistisstar.list) ? res.datalistisstar.list : [];
            that.starList = list;
          } else {
            Toast(d.msg);
          }
        }
      });
    },
  }
};
  </script>
  
  <style lang="less">
.myParrent-detail-container {
  .header {
    height: 60px;
    background: #0099cc;
    padding-top: 10px;
  }
  .content {
    padding: 0 15px;
    margin-top: -10px;
  }
  .top-info {
    background: #fff;
    border-radius: 6px;
    padding: 10px 100px 10px 10px;
    position: relative;
  }
  .top-info-list {
    display: flex;
    height: 36px;
    line-height: 36px;
    align-items: center;
  }
  .top-info-list span:nth-child(1) {
    font-size: 0.3rem;
    width: 20%;
  }
  .top-info-list span:nth-child(2) {
    font-size: 0.3rem;
    width: 80%;
  }
  .top-info img {
    width: 50px;
    height: 50px;
    position: absolute;
    top: 20px;
    right: 20px;
    border-radius: 50%;
    background: #eee;
  }
  h2 {
    padding: 10px 15px;
    font-size: 0.3rem;
    font-weight: bold;
  }
  .list {
    height: 40px;
    display: flex;
    align-items: center;
    background: #fff;
    padding: 0 15px;
  }
  .list span {
    font-size: 0.3rem;
  }
}
</style>
  